package com.spic.system.api.factory;

import com.spic.common.core.web.domain.AjaxResult;
import com.spic.system.api.RemoteActivitiTaskService;
import com.spic.system.api.RemoteBlastDeploymentService;
import com.spic.system.api.dto.BlastDto;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.ArrayList;

/**
 * RemoteBlastDeploymentFallbackFactory
 *
 * @author xuxiaochang@chinasofi.com
 * @date 2022/3/22
 */
@Component
public class RemoteBlastDeploymentFallbackFactory implements FallbackFactory<RemoteBlastDeploymentService>
{
    @Override
    public RemoteBlastDeploymentService create(Throwable cause)
    {
        return new RemoteBlastDeploymentService()
        {
            @Override
            public AjaxResult holes(BlastDto blastDto, String source)
            {
                return AjaxResult.error("服务异常，请稍后重试", new ArrayList());
            }
        };
    }
}
